package com.ocm.burnningstar.View;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.VideoView;

/**
 * Created by ocm on 2018-01-30.
 */

public class CircleVideoView extends VideoView {

    public CircleVideoView(Context context ) {
        super(context);
    }

    public CircleVideoView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }



    @Override
    protected void onDraw(Canvas canvas) {
        Path clipPath = new Path();
        int w = this.getWidth();
        int h = this.getHeight();
        Log.i("OnDraw","w:"+w+",h:"+h);
        clipPath.addRoundRect(new RectF(50, 50, w, h), 15.0f, 15.0f, Path.Direction.CW);
        canvas.clipPath(clipPath);
        super.onDraw(canvas);
    }
}
